﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SmartSpace.UI.Silverlight;
using System.ServiceModel;

namespace DynamicChart.UI
{
    public class DynamicChartModule : AppModule
    {
        public DynamicChartModule()
            :base(new Guid("{7E09C807-9C9C-4916-836D-0AC34F247364}"), "dynamic chart module")
        {
        }

        public static DynamicChart.UI.ServiceRef.DynamicChartWebServiceSoapClient CreateProxy()
        {
            System.ServiceModel.Channels.Binding binding = new System.ServiceModel.BasicHttpBinding();

            ServiceRef.DynamicChartWebServiceSoapClient client = new ServiceRef.DynamicChartWebServiceSoapClient(binding, new EndpointAddress((Application.Current as SlApp).Params.AppUrl + "Services/DynamicChartWebService.asmx"));
            return client;
        }

        public static DynamicChart.UI.ManagementRef.ManagementWebServiceSoapClient CreateManagementProxy()
        {
            System.ServiceModel.Channels.Binding binding = new System.ServiceModel.BasicHttpBinding();

            ManagementRef.ManagementWebServiceSoapClient client = new ManagementRef.ManagementWebServiceSoapClient(binding, new EndpointAddress((Application.Current as SlApp).Params.AppUrl + "Services/ManagementWebService.asmx"));
            return client;
        }
    }
}
